package com.zy.thread.ticket0;

/**
 * @Author Gong
 * @Description
 * @dATE 2021/12/13 11:39
 **/
public class Thread3 {
    public static void main(String[] args) {
        Thread th=null;
        for (int i = 0; i < 50; i++) {
            th = new Thread(new Runnable() {
                @Override
                public void run() {
                    for (int i = 0; i < 100; i++) {
                        System.out.println(Thread.currentThread().getName()+":"+i);
                    }

                }
            },"线程"+i);
            th .start();//会创建新线程，并交给cpu来调度。
        }

    }
}
